{extend name="layout/main" /}

{block name="header"}

{/block}

{block name="content"}
<section class="panel">
    <header class="panel-heading">
        <h4>文章分类列表</h4>
    </header>
    <div class="panel-body" style="padding-bottom: 50px">
        <form class="form-horizontal" action="{:url('article/cate')}">
            <div class="form-group">


                <a type="button" href="{:url('/admin/article/addcate')}" class="btn btn-info">添加分类</a>
            </div>
        </form>
        <table class="table table-bordered table-striped no-margin">
            <thead>
            <tr>
                <th class="text-center">ID</th>
                <th class="text-center">标题</th>
                <th class="text-center">创建时间</th>
                <th class="text-center">操作</th>
            </tr>
            </thead>
            <tbody>
            {if !empty($list)}
            {foreach $list as $entity}
            <tr>
                <td class="text-center">{$entity->id}</td>
                <td class="text-center">{$entity->title}</td>

                <td class="text-center">{$entity->createtime|date="Y-m-d H:i:s"}</td>
                <td class="text-center">
                    <a href="{:url('article/cateedit',['id'=>$entity->id])}" class="btn btn-xs btn-info">编辑</a>

                    <a data-url="{:url('article/catedelete',['id'=>$entity->id])}" onclick="main.ajaxDelete(this)"
                       data-msg="确定要删除该分类吗？" class="btn btn-xs btn-danger">删除</a>

                </td>
            </tr>
            {/foreach}
            {else /}
            <tr class="text-center">
                <td colspan="5">暂无数据</td>
            </tr>
            {/if}
            </tbody>
        </table>
        <div class="page">
            {:htmlspecialchars_decode($list->render())}
        </div>
    </div>
</section>
{/block}


{block name="footer"}
    <script>
        function showContent(e){
            $.dialog({
                title: '文章内容',
                content: $(e).attr('data-content')
            });
        }
    </script>
{/block}